############################################################

# Set the base image to Ubuntu

FROM ubuntu:20.04

# Working dir
WORKDIR /data

# Update the repository and install software
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server && apt-get clean && rm -rf /var/lib/apt/lists/*

# Copy sql file
COPY sql sql

# Copy initilize file
COPY init_mysql.sh ./

# Do init work
RUN chmod +x init_mysql.sh

# Init mysql for Dubhe
CMD ["/data/init_mysql.sh"]

